Historical Euphoria Gotchas, Revision 1

Every language has them, the "gotcha". Obscure parts of the syntax we must remember to avoid or work around. Things that are part of the implementation or syntax that can trap the initiated and the expert alike, Things that make code harder to read and present problems for programmers coming from a background in another language. In no particular order:

The base is the number you start counting with. in Euphoria it is base 1 so a reference to s[0] would be an error. Untold hours are wasted tracking down one off errors in code that starts counting from 0 and untold hours wasted remembering to stop counting one before the end of the length of a sequence not to mention leaving room for things like line endings of one or two characters. The choice of base influences other areas of code. In Python for loop intended to index into an array for example: for x in range(4): print x, would output 0 1 2 3 a similar statement in Euphoria for x = 1 to 4 do print x end forwould be expected to output 1 2 3 4 that is, 1 through 4 including 4.

Euphoria Basic Python C/C++ Java javascript
base 1 *base 1 base 0 base 0 base 0 base 0
  • some Basic dialect allow a base statement to choose base 1 or base 0

Syntax rules for statement separation, indentation and statement termination: the braces in C like languages, the significant white space in Python don't mix tabs and spaces. the end statement in Euphoria.

Assignment in Statements/loop counters: forbidden in Euphoria though there are workarounds if you are determined to do this.

C especially and many C based languages allow you to do many things that other languages try to prevent you from doing as a philosophy,

Some Euphoria specific implementation gotcha

  • Euphoria built dll/so/dyn with a multitasking yield suppressed
  • defaulted parameter with routine ID use since (version 4+ default parameters)
  • difference in object() uninitilized when translated

There are places in the official manual of most languages that mention considerations of optimization. You can unnecessarily slow down your program by using += or + instead of append() in at least Python and Euphoria, Though some implementations may target these statements for optimization already or have plans to add such optimizations automatically while still trying to make you aware of the potential problem and for anyone using older versions.

All languages and other software have the huge gotcha of version changes. Incompatibility and required maintenance of tools. Input.Output file format changes. Computer languages can mitigate some of these changes by accommodating older syntax and or providing warnings while still allowing some syntax from the past or reserving keywords for the future.

cross platform things:

Search



Quick Links

User menu

Not signed in.

Misc Menu